package handler;

import bean.DataTransferObject;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Vector;

public class BeanIdSimpleUrlHandler implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
        List<DataTransferObject> list = new Vector<>();
        list.add(new DataTransferObject(false, 's', 0.5f, -1, "item"));
        list.add(new DataTransferObject(true, 'v', -2.7f, 3, "stack"));
        list.add(new DataTransferObject(false, 'g', 0.5f, 6, "flow"));
        list.add(new DataTransferObject(true, 't', -0.19f, 2, "view"));
        list.add(new DataTransferObject(true, 'u', 1.8f, -9, "model"));
        ModelAndView modelAndView = new ModelAndView("two");
        modelAndView.addObject("vector", list);
        modelAndView.addObject("message", "简单url处理器映射");
        return modelAndView;
    }
}
